import pandas
# 列表输出参数--没有格式化
data = pandas.read_excel("D:/AtProgrammer/python/zip/cases.xls",dtype={'用户名':str,'密码':str,'预期结果':str})
datalist = data.values.tolist()   # 类似json
print(datalist)
print("-----------------------------")

# 格式化输出列表
data = pandas.read_excel("D:\\AtProgrammer\\python\\zip\\cases.xls",sheet_name="Sheet1",names=["yhm","mm","yuqi"],dtype={'yhm':str,'mm':str,'yuqi':str})
datalist = data.values.tolist()   # 类似json 列表读取
for i in datalist:
    # print(i)
    print(i[0],"\t",i[1],"\t",i[2])
print("-----------------------------")

# sheet_name="Sheet2" sheet分页
data = pandas.read_excel("D:\\AtProgrammer\\python\\zip\\cases.xls",sheet_name="Sheet2",names=["yhm","mm","yuqi"],dtype={'yhm':str,'mm':str,'yuqi':str})
datalist = data.values.tolist()   # 类似json 列表读取
for i in datalist:
    # print(i)
    print(i[0],"\t",i[1],"\t",i[2])
print("-----------------------------")

# skiprows=1 跳过第一行
data = pandas.read_excel("D:\\AtProgrammer\\python\\zip\\cases.xls",skiprows=1,sheet_name="Sheet2",names=["yhm","mm","yuqi"],dtype={'yhm':str,'mm':str,'yuqi':str})
datalist = data.values.tolist()   # 类似json 列表读取
for i in datalist:
    # print(i)
    print(i[0],"\t",i[1],"\t",i[2])

print("-----------------------------")
# header=None, 标注没有列名，默认是有的
data = pandas.read_excel("D:\\AtProgrammer\\python\\zip\\cases.xls",header=None,sheet_name="Sheet2",names=["yhm","mm","yuqi"],dtype={'yhm':str,'mm':str,'yuqi':str})
datalist = data.values.tolist()   # 类似json 列表读取
for i in datalist:
    # print(i)
    print(i[0],"\t",i[1],"\t",i[2])